

add_definitions(-DCFF_DLL_EXPORT)

find_package(BISON)
find_package(FLEX)

FLEX_TARGET(lexer cffformat.l   ${CMAKE_CURRENT_BINARY_DIR}/cfflexer.cpp)
BISON_TARGET(parser cffformat.y ${CMAKE_CURRENT_BINARY_DIR}/cffparser.cpp)
#ADD_FLEX_BISON_DEPENDENCY(lexer parser)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

if(WIN32)

configure_file(unistd.h.in unistd.h)

endif()



set(
	CFF_SOURCES
	cffexport.h
	cffformat.cpp
	cffformat.h
	cffformat.l
	cffformat.y
	${BISON_parser_OUTPUTS}
	${FLEX_lexer_OUTPUTS}
	)


source_group (
	"CrimsonFileFormat"
	FILES
	${CFF_SOURCES}
	)

add_library (
	CrimsonFileFormat SHARED
	${CFF_SOURCES}
	)

        
